package com.sonotec.scap.ventas.model;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Set;


/**
 * The persistent class for the t_pedido database table.
 * 
 */
@Entity
@Table(name="t_pedido")
public class TPedido implements Serializable {
	private static final long serialVersionUID = 1L;
	private int codigo;
	private double total;
	private Set<TDetallePedido> TDetallePedidos;
	private TCliente TCliente;

    public TPedido() {
    }


	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(unique=true, nullable=false)
	public int getCodigo() {
		return this.codigo;
	}

	public void setCodigo(int codigo) {
		this.codigo = codigo;
	}


	@Column(nullable=false)
	public double getTotal() {
		return this.total;
	}

	public void setTotal(double total) {
		this.total = total;
	}


	//bi-directional many-to-one association to TDetallePedido
	@OneToMany(mappedBy="TPedido")
	public Set<TDetallePedido> getTDetallePedidos() {
		return this.TDetallePedidos;
	}

	public void setTDetallePedidos(Set<TDetallePedido> TDetallePedidos) {
		this.TDetallePedidos = TDetallePedidos;
	}
	

	//bi-directional many-to-one association to TCliente
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="dni", nullable=false)
	public TCliente getTCliente() {
		return this.TCliente;
	}

	public void setTCliente(TCliente TCliente) {
		this.TCliente = TCliente;
	}
	
}